#  Executables
# Brent Smith
# brent.m.smith@colorado.edu
#
# CSCI5229 - Computer Graphics
# Homework #4: Projections
#

PROGRAM=DrumApp

CC=g++
#CFLAGS=-Wall -g `sdl-config --cflags` -DLOGUTIL_LEVEL=LEVEL_DEBUG -DWITH_SHADOWS
CFLAGS=-Wall -g `sdl-config --cflags` -DLOGUTIL_LEVEL=LEVEL_INFO -DWITH_SHADOWS

LD=g++
LDFLAGS=`sdl-config --libs` -lSDL_image -lSDL_mixer -lGL -lGLU

OBJS=main.o BaseShape.o ShapeGroup.o Player.o Fan.o Drumstick.o Room.o Vector3D.o SDL_GLApp.o DrumApp.o TextureManager.o DefaultBitmapFont.o GLXBitmapFont.o SoundManager.o LogUtil.o Composition.o ConfigManager.o object.o glWindowPos.o

# Default target
all: $(PROGRAM)

# Cleanup generated files
clean:
	rm -f $(PROGRAM) $(OBJS) *.o *.a

# Test the executable
test: $(PROGRAM)
	./$(PROGRAM)

# Generic compile for C++ .cpp to object .o
.cpp.o:
	$(CC) $(CFLAGS) -c $<

# Generic compile for C
.c.o:
	gcc $(CFLAGS) -c $<

# Create the executable
#$(PROGRAM): $(OBJS) CSCIx229.a
$(PROGRAM): $(OBJS) 
	$(LD) -o $@ $^ $(LDFLAGS)

# Create archive (include glWindowPos if you need it)
CSCIx229.a:fatal.o loadtexbmp.o print.o project.o errcheck.o object.o
	ar -rcs CSCIx229.a $^
